app.begin((req,res)=>{
    console.log("app.begin",req.url,req.params)
})

M.checkR=function (r){
    return r.code==200 || r.code==0;
}

app.get("/list",async (req,res)=>{
    const {page,num}=req.params;
    //let r=  await M.request.get("/opem/member/list",{page,num})
    res.send(M.result({}));
})


app.get("/add",async (req,res)=>{
    let r= M.request.post("/opem/member/add",req.params)
    res.send(r);
})

app.get("/delete",async (req,res)=>{
    let r= M.request.post("/opem/member/delete",req.params)
    res.send(r);
})

app.get("/update",async (req,res)=>{
    let r= M.request.post("/opem/member/update",req.params)
    res.send(r);
})


app.get("/sessionList",async (req,res)=>{
    let r=await  M.request.get("/open/session");
    let rows=[]
    Object.keys(r.data).forEach(function(key){
        let o=r.data[key];
        o.id=key;
        rows.push(o)
    });
    res.send(M.result({rows,total:rows.length}));
})